/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modelo;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author epl
 */
@Entity
@Table(name="ArticulosPedidos")
public class ArticuloPedido implements Serializable{
    @Id
    @GeneratedValue(strategy=GenerationType.TABLE)
    private long id;
    private int cantidad;
    @ManyToOne(cascade=CascadeType.PERSIST)
    private Articulo articulo;
    private float precioActualPorUnidad;
    @ManyToOne(cascade=CascadeType.ALL)
    private Invoice invoice;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Articulo getArticulo() {
        return articulo;
    }

    public void setArticulo(Articulo articulo) {
        this.articulo = articulo;
    }

    public int getCantidad() {
        return cantidad;
    }

    public void setCantidad(int cantidad) {
        this.cantidad = cantidad;
    }

    public Invoice getInvoice() {
        return invoice;
    }

    public void setInvoice(Invoice invoice) {
        this.invoice = invoice;
    }

    public float getPrecioActualPorUnidad() {
        return precioActualPorUnidad;
    }

    public void setPrecioActualPorUnidad(float precioActualPorUnidad) {
        this.precioActualPorUnidad = precioActualPorUnidad;
    }


}
